import utils from '@utils';
import Service from './Service';

// 窗户的接口
class WindowApi extends Service {

    // url = utils.isDev ? "/c_hyweb/3dapi.aspx" : "/c_hyweb/3dapi.aspx";
    url = "/hyweb/3dapi.aspx";
    // url = utils.isDev ? "/hyweb/3dapi.aspx" : "http://60.165.35.27:17089/hyweb/3dapi.aspx";

    // 1.获取所有项目
    getProjects() {
        return this._post(this.url, { action: "3d_getproject" });
    }

    // 2.获取某项目楼栋及层数
    getBuildDatas(projectId: string) {
        return this._post(this.url, {
            action: "3d_getbuild",
            data: { projectId }
        });
    }

    // 3.获取某楼栋各方位窗数量分布及安装状态
    // 1.2.2.	数据分析区调整  4.	安装状态
    getBuildWindow(buildId: string) {
        return this._post(this.url, {
            action: "3d_getbuildvis",
            data: { buildId }
        });
    }

    // 4. 获取某楼各层窗型详细分布（用于列表）
    // 1.2.2.	数据分析区调整  3.	窗型信息
    getWindowType(buildId: string) {
        return this._post(this.url, {
            action: "3d_getbuildwindetail",
            data: { buildId }
        });
    }

    //5.获取各安装状态的颜色配置
    getInstanllStateColor() {
        return this._post(this.url, {
            action: "3d getinscolor"
        });
    }

}


const windowApi = new WindowApi()

export default windowApi;